

//
//  HDTitleBtn.swift
//  HDSwfitWeibo
//
//  Created by wty on 16/4/12.
//  Copyright © 2016年 wty. All rights reserved.
//

import UIKit

class HDTitleBtn: UIButton {
 //MARK -初始化方法
     init( title:String) {
        super.init(frame:CGRectZero)
        setTitle(title, forState: UIControlState.Normal)
        setTitleColor(UIColor.blackColor(), forState: UIControlState.Normal)
        setImage(UIImage(named: "navigationbar_arrow_down"), forState: UIControlState.Normal)
//        setImage(UIImage(named: "navigationbar_arrow_up"), forState: UIControlState.Selected)
        sizeToFit()
    }


   
    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }

//MARK -重新布局子控件
    override func layoutSubviews() {
        super.layoutSubviews()
        //titleLable
        titleLabel?.frame.origin.x = 0
        //image
        imageView?.frame.origin.x = titleLabel!.bounds.width
        
    }
    


}
